package Thread;

import java.util.Scanner;

public class demo7 {
    private static int isQuit;
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
           while(isQuit == 0) {

           }
            System.out.println("线程t1退出!");
        });
        Thread t2 = new Thread(() -> {
            Scanner s = new Scanner(System.in);
            System.out.println("请输入isQuit的值: ");
            isQuit = s.nextInt();
        });
        t1.start();
        t2.start();

    }
}
